# Maintainer: Dave Reisner <dreisner@archlinux.org>
# Contributor: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Thomas Jost <schnouki@schnouki.net>
# Contributor: JaDa <jada@archlinux.us>
# Contributor: Joaquim Pedro <osmano807@gmail.com>
# Contributor: Jan Rüegg <rggjan@gmail.com>

pkgname=gperftools
pkgver=2.10
pkgrel=1
pkgdesc="Fast, multi-threaded malloc and nifty performance analysis tools"
arch=('x86_64')
url="https://github.com/gperftools/gperftools"
license=('BSD')
depends=('perl' 'libunwind' )
provides=('libtcmalloc.so'
          'libprofiler.so'
          'libtcmalloc_debug.so'
          'libtcmalloc_and_profiler.so'
          'libtcmalloc_minimal.so'
          'libtcmalloc_minimal_debug.so')
optdepends=('graphviz: pprof graph generation'
            'gv: pprof postscript generation')
source=(https://github.com/gperftools/gperftools/releases/download/$pkgname-$pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('83e3bfdd28b8bcf53222c3798d4d395d52dadbbae59e8730c4a6d31a9c3732d8')

build() {
  cd $pkgname-$pkgver

  ./configure --prefix=/usr --enable-frame-pointers --enable-libunwind
  make
}

package() {
  cd $pkgname-$pkgver

  make DESTDIR="$pkgdir" install
  install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}
